home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / scenarios / train / Train 04.scl < prev    next >
Encoding:
Text File  |  2005-11-28  |  5.1 KB  |  167 lines

  1. scenario = GetProperties()
  2. scenario.ScenarioType = 1
  3. scenario.Title = "sc_Train_04_00"
  4. scenario.Map = "Beotorum.dat"
  5. scenario.Description = "sc_Train_04_01"
  6. scenario.Picture = "Train 04.dds"
  7.  
  8. scenario.iSortOrder = 7
  9.  
  10. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_GUERILLA] = false
  11. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
  12. scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
  13. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
  14. scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
  15. scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
  16. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
  17. scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
  18. scenario.vShowMessageBoxes[STDDT_GUERILLA] = false
  19.  
  20. Player(PT_PLAYER, RACE_HUMANS)
  21. Player(PT_AI, RACE_ALIENS)
  22.  
  23. SetInitialCamera(-0.999799, 0.000000, -0.020020, 0.000000, 0.019510, 0.224254, -0.974335, 0.000000, 0.004490, -0.974531, -0.224208, 0.000000, 1663.104248, 475.652863, -1188.297974, 1.000000)
  24.  
  25. function InitialMOB()
  26.     StartMOB(1)
  27.  
  28.     ShowBallon(1, -1, MBS_CENTER, 26, 36, "sc_Train_04_02a")
  29.     SelectCountry(2)
  30.     ShowBallon(1, -1, MBS_CENTER, 26, 36, "sc_Train_04_02")
  31.     UnselectCountry(2)
  32.  
  33.     FlyCamera(0.999754, 0.000000, -0.022175, 0.000000, 0.020990, 0.322563, 0.946315, 0.000000, 0.007153, -0.946548, 0.322483, 0.000000, 1816.183472, 385.874878, -1654.376465, 1.000000)
  34.     SelectUnit2(1)
  35.     SelectUnit2(2)
  36.     SelectUnit2(3)
  37.     SelectUnit2(4)
  38.     ShowBallon(2, -1, MBS_LEFT, 28, 42, "sc_Train_04_03")
  39.  
  40.     FlyCamera(0.999856, -0.000000, -0.016959, 0.000000, 0.016917, 0.070778, 0.997349, 0.000000, 0.001200, -0.997492, 0.070767, 0.000000, 1727.739746, 387.422821, -1454.318726, 1.000000)
  41.     MoveUnit(1, 25, 41)
  42.     MoveUnit(2, 26, 42)
  43.     MoveUnit(3, 27, 43)
  44.     MoveUnit(4, 28, 42)
  45.     ShowBallon(3, -1, MBS_CENTER, 29, 41, "sc_Train_04_04")
  46.  
  47.     UnselectUnit(1)
  48.     UnselectUnit(2)
  49.     UnselectUnit(3)
  50.     UnselectUnit(4)
  51.  
  52.     MoveUnit(1, 25, 37)
  53.     MoveUnit(2, 26, 38)
  54.     MoveUnit(3, 27, 39)
  55.     MoveUnit(4, 28, 38)
  56.     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_04_05")
  57.  
  58.     FlyCamera(-0.999052, 0.000000, -0.043522, 0.000000, 0.041621, 0.292318, -0.955415, 0.000000,0.012722, -0.956321, -0.292040, 0.000000,1658.933228, 341.057404, -1177.537720, 1.000000)
  59.  
  60.     ShowBallon(51, -1, MBS_CENTER, 26, 32, "sc_Train_04_06")
  61.     ShowBallon(51, -1, MBS_CENTER, 26, 32, "sc_Train_04_06b")
  62.  
  63.     ShowBallon(51, -1, MBS_CENTER, 26, 32, "sc_Train_04_07")
  64.  
  65.     SelectUnit2(1)
  66.     SelectUnit2(4)
  67.         ShowBallon(51, -1, MBS_CENTER, 26, 32, "sc_Train_04_08")
  68.     --ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_04_08")
  69.     UnselectUnit(1)
  70.     UnselectUnit(4)
  71.  
  72.     FinishMOB()
  73. end
  74.  
  75. old_prompt = ""
  76.  
  77. function OnUpdate()
  78.     if GetGamePhase() == PHASE_GUERRILLA then
  79.         if GetMoney(2, MONEY_GUERRILLA) > 0 then
  80.             if GetSelectedCountry() == 0 then
  81.                 ShowPrompting("sc_Train_04_09")
  82.             else
  83.                 ShowPrompting("sc_Train_04_10")
  84.             end
  85.         end
  86.     elseif not AllUnitsMovedAndFiredIfCould() then
  87.         ShowPrompting("sc_Train_04_11")
  88.     end
  89.  
  90.     if not HasPrompting() then
  91.         ShowPrompting("sc_Train_finish_phase")
  92.     end
  93. end
  94.  
  95. function OnHexClicked(x, y, clicked_unit, selected_unit, command)
  96.     if command == CMD_SETUP then
  97.         if GetType(selected_unit) ~= LBOT then
  98.             IncorrectAction("sc_Train_04_13")
  99.             return
  100.         end
  101.  
  102.         local bEnemyNearby = false
  103.  
  104.         for enemy = 1, 4 do
  105.             if GetDistance(selected_unit, enemy) <= GetMaxWR(selected_unit) then
  106.                 bEnemyNearby = true
  107.             end
  108.         end
  109.  
  110.         if not bEnemyNearby then
  111.             IncorrectAction("sc_Train_04_14")
  112.         end
  113.     end
  114. end
  115.  
  116. function OnCountryInvaded(country, color)
  117.     if(country == 1 and color == COLOR_GREEN) then
  118.         IncorrectAction("sc_Train_04_15")
  119.     end
  120. end
  121.  
  122. function OnCountryCaptured(country, color)
  123.     if(country == 2 and color == COLOR_GREEN) then
  124.         StartMOB(1)
  125. --                FlyCamera(-0.999249, 0.000000, 0.038752, 0.000000, -0.033416, 0.506388, -0.861658, 0.000000,-0.019624, -0.862306, -0.506008, 0.000000,1662.984253, 313.746216, -1270.524658, 1.000000)
  126.                 --FlyCamera(-0.984889, 0.000000, -0.173187, 0.000000, 0.076259, 0.897837, -0.433674, 0.000000,0.155494, -0.440328, -0.884270, 0.000000,1658.933228, 231.031357, -1177.537720, 1.000000)
  127.                 FlyCamera(-0.996527, -0.000000, -0.083273, 0.000000, 0.011524, 0.990378, -0.137906, 0.000000,0.082471, -0.138387, -0.986938, 0.000000,1735.486938, 106.910278, -1197.580078, 1.000000)
  128.  
  129.         ShowXBallon(51, -1, MBS_CENTER, 313, 546, "sc_Train_04_12")
  130.         FinishMOB()
  131.     end
  132. end
  133.  
  134. function aiInvasion(country)
  135.     if (country == 1) then 
  136.         aiMustNot()
  137.     end
  138. end
  139.  
  140. function aiDefence(country)
  141.     if (country == 2) then 
  142.         aiMustNot()
  143.     end
  144. end
  145.  
  146. function CheckForVictory()
  147.     if(GetAliveUnitsAmount(COLOR_RED) == 0) then return GAMERESULT_VICTORY end
  148.     if(GetCountryControl(2) == COLOR_RED) then return GAMERESULT_DEFEAT end
  149.     return GAMERESULT_NONE
  150. end
  151.  
  152. function InitialSetup()
  153.     Country(1, ALLIANCE_FL_ALLY)
  154.     Money(1, MONEY_TOTAL_REVENUE, 0)
  155.  
  156.     Country(2, ALLIANCE_NEUTRAL)
  157.     PlaceCapital(2, 26, 32)
  158.  
  159.     SetupUnit(1, TANKA, 25, 45)
  160.     SetupUnit(2, TANKA, 26, 46)
  161.     SetupUnit(3, TANKA, 27, 45)
  162.     SetupUnit(4, TANKA, 28, 46)
  163.  
  164.     SetHP(1, 3)
  165.     SetHP(4, 3)
  166. end
  167.